<!DOCTYPE html>
<html lang="zh-cn">
<head>
	<meta charset="UTF-8">
	<title>钻石会员认证</title>
	<meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport"/>
	<meta content="yes" name="apple-mobile-web-app-capable"/>
	<meta content="black" name="apple-mobile-web-app-status-bar-style"/>
	<meta content="telephone=no" name="format-detection"/>
<link rel="shortcut icon" href="/carworld_weixin/images/favicon.ico" />

	<link type="text/css" rel="stylesheet" href="/carworld_weixin/themes/css/base.css">
	<link type="text/css" rel="stylesheet" href="/carworld_weixin/themes/css/home.css">
	<link type="text/css" rel="stylesheet" href="/carworld_weixin/themes/css/icon.css">
</head>
	<body>

	<header class="aui-navBar aui-navBar-fixed b-line">
		<a href="javascript:history.go(-1);" class="aui-navBar-item">
			<i class="icon icon-return"></i>
		</a>
		<div class="aui-center">
			<span class="aui-center-title">钻石会员认证</span>
		</div>
		<a href="javascript:;" class="aui-navBar-item">
			<i class="icon icon-sys"></i>
		</a>
	</header>
	<section class="aui-scrollView">
		<div class="aui-code-box">
			<div class="aui-cash-list aui-card-list" id="bodyall">
				<p class="aui-code-line">
					<i class="icon icon-mine"></i>
					<input type="text" class="aui-code-line-input" name="name" value=""id="userName" autocomplete="off"
						   placeholder="请输入您的真实姓名">
				</p>
				<p class="aui-code-line">
					<i class="icon icon-phone"></i>
					<input type="text" class="aui-code-line-input" name="phone" value="" id="mobile" autocomplete="off"
						   placeholder="请输入您的预留手机号码">
				</p>
				<div class="aui-code-btn">
					<button id="validateBtn">认证</button>
				</div>
			</div>
		</div>


	</section>
	</body>
<script type="text/javascript" src="/carworld_weixin/themes/js/jquery.min.js"></script>
<script type="text/javascript" src="/carworld_weixin/themes/js/slider.js"></script>
<script type="text/javascript" src="/carworld_weixin/themes/js/layer.js"></script>

	<script src="/carworld_weixin/js/style.js"></script>
	<script>


        $.ajax({
            type : 'get',
            url : '/carworld_weixin/user/getUserInfo',
            success : function(data) {

                if (data.user.user_role != 0) {
					$("#bodyall").empty();
                    $("#bodyall").append('<h>您已经是钻石会员,身份升级请联系店长：(02)89580828</h>');
                }
            }
        });

		$('#validateBtn').click(function() {


			var userName = $('#userName').val();
			var mobile = $('#mobile').val();
			if (userName == null) {
				alert('用户名不能为空');
				return;
			}
			if (mobile == null) {
				alert('手机号不能为空');
				return;
			}

			$.ajax({
				type : 'POST',
				url : '/carworld_weixin/user/validation',
				data : {
					'userName' : userName,
					'mobile' : mobile
				},
				dataType : 'text',
				success : function(result) {

					if(result=='success'){
						alert('会员身份验证通过，正在加载首页...');
						window.location.href='/carworld_weixin/';
					}else{
						alert('该会员不存在!')
					}
				},
				error : function(jqXHR, textStatus, errorThrown) {
					alert(textStatus);
					
				}
			});

		})
	</script>


</body>
</html>
